import Vue from 'vue'
import { USER_INFO, ACCESS_TOKEN, USER_TYPE } from '../store/mutation-types'
const getters = {
  device: state => state.app.device,// 设备mobile pc
  theme: state => state.app.theme,// 主题 'dark', 'light'
  color: state => state.app.color,// 颜色
  token: state => () => state.user.token?state.user.token:state.user.token= Vue.ls.get(ACCESS_TOKEN),

  avatar: state => state.user.avatar ,
  username: state => state.user.username,
  realname: state => state.user.realname,
  avatar_fileUrl: state => state.user.avatar_fileUrl ,

  welcome: state => state.user.welcome,
  permissionList: state => ()=>state.user.permissionList,
  auth:state=>state.user.auth,
  userInfo: state => state.user.info,
  userType: state =>state.user.type ? state.user.type: state.user.type = Vue.ls.get(USER_TYPE),

};

export default getters